package com.ssy.lingxi.order.model.vo.process.request;

import com.ssy.lingxi.order.handler.annotation.ContractSourceTypeAnnotation;
import com.ssy.lingxi.order.handler.annotation.DateStringFormatAnnotation;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 新增采购流程 - 合同详情
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-24
 */
public class OrderPurchaseProcessContractVO implements Serializable {
    private static final long serialVersionUID = -3074842639161686877L;

    /**
     * 合同Id
     */
    @NotNull(message = "合同Id要大于0")
    @Positive(message = "合同Id要大于0")
    private Long contractId;

    /**
     * 合同编号
     */
    @NotBlank(message = "合同编号不能为空")
    @Size(max = 20, message = "合同编号最长20个字符")
    private String contractNo;

    /**
     * 合同摘要
     */
    @NotBlank(message = "合同摘要不能为空")
    @Size(max = 60, message = "合同摘要最长60个字符")
    private String digest;

    /**
     * 生效时间，格式为yyyy-MM-dd
     */
    @NotBlank(message = "合同生效时间不能为空")
    @DateStringFormatAnnotation(message = "合同生效时间格式不正确")
    private String effectTime;

    /**
     * 失效时间
     */
    @NotBlank(message = "合同失效时间不能为空")
    @DateStringFormatAnnotation(message = "合同失效时间格式不正确")
    private String expireTime;

    /**
     * 合同乙方
     */
    @NotBlank(message = "合同乙方不能为空")
    @Size(max = 200, message = "合同乙方最长200个字符")
    private String partyB;

    /**
     * 合同金额
     */
    @NotNull(message = "合同金额要大于0")
    @Positive(message = "合同金额要大于0")
    @Max(value = 1000000000, message = "合同金额不能超过10亿")
    private BigDecimal amount;

    /**
     * 合同询源类型，0-所有类型，1-采购询价，2-采购招标，3-采购竞价
     */
    @NotNull(message = "合同询源类型不能为空")
    @ContractSourceTypeAnnotation
    private Integer contractType;

    /**
     * 对应单据
     */
    @Size(max = 30, message = "对应单据最长30个字符")
    private String receiptNo;

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public String getContractNo() {
        return contractNo;
    }

    public void setContractNo(String contractNo) {
        this.contractNo = contractNo;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public String getEffectTime() {
        return effectTime;
    }

    public void setEffectTime(String effectTime) {
        this.effectTime = effectTime;
    }

    public String getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(String expireTime) {
        this.expireTime = expireTime;
    }

    public String getPartyB() {
        return partyB;
    }

    public void setPartyB(String partyB) {
        this.partyB = partyB;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public Integer getContractType() {
        return contractType;
    }

    public void setContractType(Integer contractType) {
        this.contractType = contractType;
    }

    public String getReceiptNo() {
        return receiptNo;
    }

    public void setReceiptNo(String receiptNo) {
        this.receiptNo = receiptNo;
    }
}
